zz_

test/isEven.test.js

zzmq.dev@gmail.com[dev3]/mathkit[add-median-numbers-function-returns] / test / isEven.test.js @ e84ab4c7 Download
Ladder Summary
  • file Contains unit tests to verify the functionality of the isEven function, testing positive numbers, negative numbers, and zero.
import { test } from "node:test";
import assert from "node:assert/strict";
import { isEven } from "../src/isEven.js";

test("isEven with positive numbers", () => {
  assert.strictEqual(isEven(1), false);
  assert.strictEqual(isEven(2), true);
});

test("isEven with negative numbers", () => {
  assert.strictEqual(isEven(-1), false);
  assert.strictEqual(isEven(-2), true);
});

test("isEven with zero", () => {
  assert.strictEqual(isEven(0), true);
});